﻿namespace Taobao.Tools
{
    using Castle.ActiveRecord;
    using Castle.ActiveRecord.Framework.Config;
    using System;
    using System.Diagnostics;
    using System.Reflection;
    using System.Windows.Forms;

    internal static class Program
    {
        [STAThread]
        private static void Main()
        {
            XmlConfigurationSource source = new XmlConfigurationSource("ARconfig.xml");
            ActiveRecordStarter.Initialize(Assembly.Load("Taobao.Model"), source);
            Console.WriteLine("初始化成功");
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length > 1)
            {
                MessageBox.Show("应用程序已经在运行了");
            }
            else
            {
                Application.Run(new Form1());
            }
        }
    }
}

